package com.SouthernWall_404.AgeDust.Common.Event;

import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;

public class PlayerIDEvent {

    @SubscribeEvent
    public static void onRightClick(PlayerEvent.NameFormat event)
    {

//        Player player=event.getEntity();
//
//        if(player.getCapability(PlayerPersonalityProvider.PLAYER_PERSONALITY_CAPABILITY).isPresent())
//        {
//            CharacterInfo characterInfo=player.getCapability(PlayerPersonalityProvider.PLAYER_PERSONALITY_CAPABILITY).orElse(null).characterInfo;
//            Component newName = Component.literal(characterInfo.name);
//            event.setDisplayname(newName);
//
////
////            if (!player.level().isClientSide)
//            {
//                GameProfile gameProfile = player.getGameProfile();
//                gameProfile.
//                String string = gameProfile.getName();
//                player.setCustomName(newName);
//                player.setCustomNameVisible(true);
//            }
//
//            Component UserName=event.getUsername();
//            Component displayname=event.getDisplayname();
//        }
//        // 为所有玩家添加前缀 [MOD]
    }


}
